namespace cpp iqiyi.kvservice

struct ThNode {
    1: string addr
    2: string port
}

enum ThBackendClusterType {
    UNKNWON = 0,

    COUCHBASE = 1,
    AEROSPIKE = 2,
    REDIS_SINGLE = 3,
    REDIS_CLUSTER = 4,

    XDR_PRODUCER = 10
}

struct ThBackendCluster {
    1: ThBackendClusterType cluster_type
    2: string cluster_name
    3: list<ThNode> nodes
}

struct ThResource {
    1: string resource_name

    2: string db_name
    3: string db_passwd
    4: string auth_rdonly
    5: string auth_wronly
    6: string auth_rdwr
    7: map<string, string> options

    8: string backend_cluster_name
    9: string proxy_cluster_name
    10: string monitor_cluster_name
}

struct ThXdcInfo {
    1: string task_name;
    2: i32 task_cookie;
    3: string source_resource_name;//used
    4: string producer_agent_name;//used
    5: list<ThNode> producer_hq_nodes;

    6: string baseline_agent_name;
    7: list<ThNode> baseline_hq_nodes;

    8: list<string> target_resource_names;
    9: list<string> consumer_agent_names;
    10:list<list<ThNode>> consumer_hq_nodes_list;

    11: string hq_topic;//used
}

struct ThXdcAgent {
    1: string agent_name;
    2: ThNode agent_node;
}

enum ThXdcOperation {
    ADD = 1,
    REPLACE = 2,
    SET = 3,
    DELETE = 4,
    TRACE = 99
}

struct ThXdcMessage {
    1: ThXdcOperation xdc_op;//used
    2: i64 op_time;
    3: i64 seqno;
    4: i32 queue_id;
    5: string broker_name;
    6: i64 queue_offset;

    7: string key;//used
    8: binary value;//used
    9: i32 exptime;//used
}

